<?php 
session_start(); 
if(!isset($_SESSION['IsLogin']))
{
	die("Thank you for your using this application! </br> To reaccess this page, you need to <a href='index.php'>LOGIN</a>"); // Make sure they are logged in!
}
else
{
	echo "<h3>Hello ".$_SESSION['IsLogin']."!</h3>";
	print "<form action ='email.php' method='post'>";
	print '<div class="cart_title"></div>';
	print  "<input type= 'submit' name= 'logout' value= 'Log out'>";
	if(isset($_POST['logout']))
	{
		session_destroy();
		Header("Location: email.php");
		
	}
	
	print "</form>";
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<title>Shop</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="css/iecss.css" />
<![endif]-->
<script type="text/javascript" src="js/boxOver.js"></script>
<script type="text/javascript">  

</script>
</head>
<body>
<div id="main_content"> 
   
            <div id="menu_tab">
            <div class="left_menu_corner"></div>
                    <ul class="menu">
                         <li><a href="index.php" class="nav1">  Home </a></li>
                         <li class="divider"></li>
                    </ul>

             <div class="right_menu_corner"></div>
            </div><!-- end of menu tab -->

<?php
include 'product_data.inc';

//define functions
require_once 'functions.inc';
$all_users=  arrayfile_to_array('./user_data.dat');
$username = $_SESSION['IsLogin'];
$to=$_POST['email'];
$subject = 'Shop Register Confirmation';
$message = 'Hello! You have bougth something from out shop. Please ....';
$headers = "From: abc";
$mailsent = @mail($to,$subject,$message,$headers);
echo "<h3>Please confirm your email: ".$to."</h3>";
print "";
?>
